#include "processpool.hpp"

int main(int argc, char* argv[])
{

    if(argc != 2)
    {
        cout << "Use: " << argv[0] << " Process_Num" << endl;
        return ArgcError; 
    }

    int process_num = atoi(argv[1]);
    if(process_num <= 0)
        return ProcessNumError;

    ProcessPool* processpool = new ProcessPool(process_num);
    //processpool->MakePipeName();
    processpool->Random_MakePipeName();
    processpool->CreateProcessPool(worker);

    srand((unsigned int)time(nullptr));
    processpool->RunTask(processpool);

    delete processpool;
    
    return 0;
}